<template>
  <div class="block">
    <el-date-picker
      v-model="pData.zhi"
      type="month"
      value-format="yyyy-MM"
      placeholder="选择年月"
      :disabled="pData.isEdit && pData.allowModification == 0">>
    </el-date-picker>
  </div>
</template>

<script>
    export default {
      name: "dataYearMonth",
      props: {
          pData: Object
      },
      data() {
        return {
        }
      },
      watch: {
        'pData.zhi': {
          handler(newName, oldName) {
            let nameEn = this.pData.nameEn;
            let clickName = this.pData.onclickName;
            const data = {};
            data[nameEn] = newName;
            this.$emit(clickName, data)
          },
          deep: true,
        },
      },
      created() {},
      methods: {
        clearZhi() {
          this.pData.zhi = "";
        }
      },
    }
</script>

<style scoped>

</style>
